﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Data;
using System.ComponentModel;
using System.Xml;
using System.Xml.XPath;
using System.Xml.Serialization;
namespace QA_System
{
    public class InputData
    {
        static public byte[] readFiletobyte(string filename)
        {
            try
            {
                Stream inputStream = File.OpenRead(filename);
                byte[] getByte = new byte[20000];
                int i = 0;
                int byteread;
                byte[] perBtye = new byte[1024];
                while ((byteread = inputStream.Read(perBtye, 0, 1024)) > 0)
                {
                    for (int j = 0; j < byteread; j++) getByte[i + j] = perBtye[j];
                    i += byteread;
                }
                byte[] outByte = new byte[i];
                for (int j = 0; j < i; j++) outByte[j] = getByte[j];
                inputStream.Close();
                return (outByte);
            }
            catch (OperationAbortedException ex)
            {
                throw (ex);
            }
        }

        

        
    }

}
